#!/bin/sh

mcu() {
#mcu
#gpio0-1
oraygpio -M 100 -S 0x5000 -H -G 0 -N 1
#gpio0-2
oraygpio -M 101 -S 0x5000 -L -G 0 -N 2
#uart4
oraygpio -M 51 -S 0x502
oraygpio -M 52 -S 0x502
}

led() {
#指示灯 gpio 模式
oraygpio -M 60 -S 0x600
oraygpio -M 61 -S 0x600
oraygpio -M 95 -S 0x401
}

start() {
  mcu
  led
}

stop() {
  return 0
}

case "$1" in
start)
  start > /dev/null
  ;;
stop)
  stop
  ;;
restart | reload)
  stop
  start
  ;;
mcu)
  mcu
  ;;
led)
  led
  ;;
*)
  echo "Usage: $0 {start|stop|restart|mcu|led}"
  exit 1
  ;;
esac

exit $?
